//
//  AdsDetailController.m
//  MindBox
//
//  Created by MS on 16-1-8.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//

#import "AdsDetailController.h"
#import "UMSocial.h"
@interface AdsDetailController ()

@end

@implementation AdsDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.webView.scrollView.bounces = YES;
    
    if (self.urlStr) {
        
        [self loadNewDataWithUrlStr:self.urlStr];
    }

}

-(void)setNavBar
{
    [super setNavBar];
    
    MyNavigationItem * rightItem1 =[MyNavigationItem navigationItemWithImage:@"ic_bg_white_more" andHighlightImage:@"ic_bg_white_more" andTag:0 andTitle:nil addTarget:self action:@selector(rightClick:)];
    
    MyNavigationItem * rightItem2 =[MyNavigationItem navigationItemWithImage:@"ic_bg_white_share" andHighlightImage:@"ic_bg_white_share" andTag:1 andTitle:nil addTarget:self action:@selector(rightClick:)];
    
    [self.navBar setNavigationBarWithBgImageName:@"无" andTitle:nil  andTitleView:nil andLeftItems:nil andRightItems:@[rightItem1,rightItem2]];
    
    UILabel * titleView = [[UILabel alloc] initWithFrame:CGRectMake(80, 0, self.view.width-160, 44)];
    titleView.font = [UIFont systemFontOfSize:15];
    titleView.textAlignment = NSTextAlignmentCenter;
    titleView.text = self.title;
    [self.navBar addSubview:titleView];
}

-(void)rightClick:(UIButton *)btn
{
    if (btn.tag==1) {
        
        [self socailShare];
    }
    
}

-(void)socailShare
{
    [UMSocialSnsService presentSnsIconSheetView:self
                                         appKey:@"5683d356e0f55ae352001f4c"
                                      shareText:self.urlStr
                                     shareImage:nil
                                shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToWechatSession,UMShareToQQ,nil]
                                       delegate:nil];
}


-(void)dealloc
{
//    NSLog(@"AdsDetailController卸载") ;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
